﻿<%@ Page Language="C#" MasterPageFile="~/admin/Admin.Master" AutoEventWireup="true"
    Codebehind="IconList.aspx.cs" Inherits="CMS.admin.IconList" Title="Hệ thống quản trị nội dung - quản lý banner" %>

<%@ Register Assembly="ComponentArt.Web.UI" Namespace="ComponentArt.Web.UI" TagPrefix="ComponentArt" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <script type="text/javascript">
      function deleteRow(rowId)
      {           
        Grd1.Delete(Grd1.GetRowFromClientId(rowId));
      }   	
      function onCallbackError(excString)
      {                
         alert(excString);        
         Grd1.Page(0); 
         return(true);
      }     
    </script>

    <div style="border: solid 1px #ccc;">
        <div id="toolbox">
            <div class="header" style="float: left; margin-left: -40px;">
                <img src="../images/Toolbox/icon-48-article-add.png" alt="" id="imgHeader" />
                Quản lý Icon Index: danh sách
            </div>
            <div style="float: right;">
                <table class="toolbar">
                </table>
            </div>
        </div>
    </div>
    <p align="center">
        <br />
        <asp:Label ID="lblMessage" runat="server" BackColor="White" BorderColor="White" ForeColor="Red"></asp:Label>
    </p>
    <div id="content-box">
        <div class="t">
            <div class="t">
                <div class="t">
                </div>
            </div>
        </div>
        <div class="m" style="height: 520px;">
            <br />
            <ComponentArt:Grid ID="Grd1" EnableViewState="true" SelectedRowCssClass="SelectedRow" AllowEditing="true" EditOnClickSelectedItem="false"
                ShowHeader="False" CssClass="Grid" KeyboardEnabled="false" FooterCssClass="GridFooter"
                RunningMode="Callback" AutoCallBackOnDelete="true"  ClientSideOnCallbackError="onCallbackError" AllowHtmlContent="true" PagerStyle="Numbered"
                PagerTextCssClass="PagerText" PageSize="15" ImagesBaseUrl="../images/" LoadingPanelClientTemplateId="LoadingFeedbackTemplate"
                Width="830" LoadingPanelPosition="MiddleCenter" runat="server" SliderHeight="25">
                <Levels>
                    <ComponentArt:GridLevel RowCssClass="Row" AlternatingRowCssClass="AlternatingRow"
                        DataCellCssClass="DataCell" HeadingCellCssClass="HeadingCell" HeadingTextCssClass="HeadingCellText"
                        SortAscendingImageUrl="asc.gif" SortDescendingImageUrl="desc.gif" SortImageWidth="9"
                        SortImageHeight="5">
                        <Columns>
                            <ComponentArt:GridColumn Align="Center" DataCellClientTemplateId="chkTemplate" DataField="categoryId"
                                HeadingText="&lt;img src='../images/selected.gif' border='0' /&gt;" Width="20" AllowSorting="False" />
                            <ComponentArt:GridColumn DataField="categoryName" HeadingText="T&#234;n Icon" Width="100" Align="Center" />
                            <ComponentArt:GridColumn DataField="img" HeadingText="Ảnh" DataCellClientTemplateId="AnhTemplate"
                                Width="180" Align="Center"/>
                            <ComponentArt:GridColumn DataField="status" HeadingText="Trạng th&#225;i" Width="70" AllowSorting="False"
                                DataCellClientTemplateId="StatusTemplate" />
                            <ComponentArt:GridColumn DataField="categoryId" AllowSorting="False" HeadingText="Sửa"
                                Width="40" DataCellServerTemplateId="EditTemplate" EditControlType="EditCommand"
                                Align="Center" />
                        </Columns>
                    </ComponentArt:GridLevel>
                </Levels>
                <ServerTemplates>
                    <ComponentArt:GridServerTemplate ID="EditTemplate" runat="server">
                        <Template>
                            <a href="IconAE.aspx?Id=<%# HttpUtility.UrlEncode(Common.DAL.Encrypt(Container.DataItem["categoryId"].ToString())) %>">
                                <img src="../images/edit.gif" border="0" title="Sửa" /></a>
                        </Template>
                    </ComponentArt:GridServerTemplate>
                </ServerTemplates>
                <ClientTemplates>
                    <ComponentArt:ClientTemplate ID="chkTemplate" runat="server">
                        <table width="100%" cellspacing="0" cellpadding="0" border="0">
                            <tr>
                                <td align="center" style="padding-left: 0px;">
                                    <input type="radio" class="checkbox" value="## DataItem.GetMember('categoryId').Value ##"
                                        name="categoryId" id="categoryId" />
                                </td>
                            </tr>
                        </table>
                    </ComponentArt:ClientTemplate>
                    <ComponentArt:ClientTemplate ID="StatusTemplate" runat="server">
                        <table width="100%" cellspacing="0" cellpadding="0" border="0">
                            <tr>
                                <td align="center" style="padding-left: 5px;">
                                    ## if(DataItem.GetMember("status").Value == 1) { '<img src="../images/tick.png" border="0" />'
                                    } ## ## if(DataItem.GetMember("status").Value == 0) { '<img src="../images/publish_x.png"
                                        border="0" />' } ##
                                </td>
                            </tr>
                        </table>
                    </ComponentArt:ClientTemplate>
                    <ComponentArt:ClientTemplate ID="AnhTemplate" runat="server">
                        <table width="100%" cellspacing="0" cellpadding="0" border="0">
                            <tr>
                                <td align="center" style="padding-left: 5px;">
                                    <img src="<%ConfigurationManager.AppSettings["ImageUrl"].ToString()%>## DataItem.GetMember('img').Value ##" border="0" />
                                </td>
                            </tr>
                        </table>
                    </ComponentArt:ClientTemplate>
                   <ComponentArt:ClientTemplate ID="LoadingFeedbackTemplate" runat="server">
                        <table cellspacing="0" cellpadding="0" border="0">
                            <tr>
                                <td style="font-size: 10px;">
                                    Đang tải...&nbsp;</td>
                                <td>
                                    <img src="../images/spinner.gif" border="0"></td>
                            </tr>
                        </table>
                    </ComponentArt:ClientTemplate>
                </ClientTemplates>
            </ComponentArt:Grid>
            <div class="clr">
            </div>
        </div>
        <div class="b">
            <div class="b">
                <div class="b">
                </div>
            </div>
        </div>
    </div>
</asp:Content>
